package top.toptimus.dto.accessory;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.util.StrNumberUtil;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class AccessoryDTO {
    //  辅料类别
    private String subMaterialTypeId;//辅料类别id
    private String subMaterialType;//辅料类别

    //  辅料基础属性
    private String subMaterialSupplier;//供应商
    private String subMaterialPicture;//图片
    private String subMaterialNumber;//品番（供应商编码）
    private String subMaterialCode;//辅料编码
    private String subMaterialName;//辅料名称
    private String subMaterialSpec;//规格
    private String subMaterialSpecDesc;//规格描述

    public void build() {
        //  清洗编码
        try {
            this.subMaterialSpec = StrNumberUtil.getNumberText(this.subMaterialSpecDesc);
        } catch (Exception e) {
            this.subMaterialSpec = "0";
        }
    }
}
